How can I make API call before terminating the app

welcome to shbcf.ru